<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMotsTable extends Migration
{
    /**
     * 车辆年检
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mots', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('car_id')->default(0)->comment('车辆id');
            $table->timestamp('start')->nullable()->comment('起始时间');
            $table->timestamp('end')->nullable()->comment('结束时间');
            $table->string('address')->nullable()->comment('年检地点');
            $table->timestamp('limit_year')->comment('下次年检时间');
            $table->decimal('price',10,2)->default(0.00)->comment('年检价格');
            $table->text('contents')->nullable()->comment('年检项目');
            $table->text('image')->nullable()->comment('年检图片');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mots');
    }
}
